#!/bin/bash
DIR_data=`pwd`
fitfile=$1
zeroname=$2
if [ $# -ne 2  ]
then
	echo "usage[xzerocorr.sh a.fit Zero.fit   ]"
	exit 0
fi
#============================
cd $HOME/iraf
cp -f login.cl.old login.cl
echo noao >> login.cl
echo imred >>login.cl
echo ccdred >>login.cl
echo "cd $DIR_data" >> login.cl
echo $fitfile $zeroname
#echo "ccdpro(images=\"$fitfile\", output=\"  \",ccdtype-, trim-,zerocor+,darkcor-,flatcor-,zero=\"$zeroname\")" >>login.cl
echo "ccdpro(images=\"$fitfile\", output=\" \",trim-,zerocor+,darkcor-,flatcor-,zero=\"$zeroname\")" >>login.cl
echo logout >> login.cl
#cl < login.cl
cl < login.cl >xlogfile
cd $HOME/iraf
cp -f login.cl.old login.cl
cd $DIR_data
